class Exception

  def to_fxml
    xml = Builder::XmlMarkup.new
    xml.instruct!
    xml.exception do
      xml.message message
      xml.type self.class
      xml.backtrace backtrace.try(:join, "\n")
    end
  end

end